<include file="Public:header" />
<include file="Public:leftside" />
<link rel="stylesheet" type="text/css" href="/Store/css/WdatePicker/skin/WdatePicker.css" />
<script src="/Store/css/WdatePicker/WdatePicker.js" type="text/javascript" charset="utf-8"></script>
<div class="main-content">
    <div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">
        <ul class="breadcrumb">
            <li><i class="icon-home home-icon"></i><a href="/">首页</a></li>
            <li class="active">店铺管理</li>
        </ul>
    </div>
    <div class="page-content">
        <form action="{:U('Store/store_list')}" method="get" class="form-inline">
        	<section class="panel-default m-b-sm" style="margin:5px 0;">
				<div class="alert alert-info">
					<p>
	                  <i class="fa fa-hand-o-right m-r-xs"></i><strong>操作提示</strong>
	                </p>
                    <p class="alert-p m-l-xl"><i class="fa fa-caret-right m-r-xs"></i>该页面展示了商城店铺所有的商品信息，可对店铺进行编辑修改操作。</p>
                    <p class="alert-p m-l-xl"><i class="fa fa-caret-right m-r-xs"></i>可输入店铺名称关键字进行搜索。</p>
            	</div>
			</section>
           <div class="row padder-v">
				<div class="col-sm-1">
					<a href="{:U('Store/storeAdd')}" class="btn btn-sm btn-primary"><i class="fa fa-plus"></i> 添加店铺 </a> 
				</div>
				<div class="col-sm-2">
					店铺名称：
					<input type="text" name="title" value="{$_GET['title']}" class="form-control input-sm " placeholder="请输入店铺名称" style="width: 60%" />
				</div>
				<div class="col-sm-4">
					时间：
					<input type="text" onclick="WdatePicker()" class="form-control input-sm" style="width: 30%" name="addtime" value="<?PHP echo $_GET['addtime']?$_GET['addtime']:''; ?>">
					-
					<input type="text" onclick="WdatePicker()" class="form-control input-sm" style="width: 30%" name="addtime1" value="<?PHP echo $_GET['addtime1']?$_GET['addtime1']:''; ?>">
				</div>
				<div class="col-sm-2">
					是否营业：<select name="status">
	                			<option value="" <?=I('get.status') === ''?'selected':''?>>全部</option>
	                			<option value="0" <?=I('get.status') === '0'?'selected':''?>>停业</option>
	                			<option value="1" <?=I('get.status') === '1'?'selected':''?>>营业</option>
	                		 </select>
				</div>
				<div class="col-sm-2">
				是否推荐：  <select name="recommend">
		                		<option value="" <?=I('get.recommend') === ''?'selected':''?>>全部</option>
		                		<option value="0" <?=I('get.recommend') === '0'?'selected':''?>>不推荐</option>
		                		<option value="1" <?=I('get.recommend') === '1'?'selected':''?>>推荐</option>
		                	</select>
				</div>
				<div class="col-sm-1">
					<button class="btn btn-sm btn-info" type="submit">搜索</button>
					
				</div>
			</div>
			
		
        </form>

 
			<table id="sample-table-1" class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>店铺名称</th>
					<th>联系人</th>
					<th>电话</th>
					<th width="100">平台抽取比率</th>
                	<th width="100">状态</th>
                	<th width="200">加入时间</th>
                	<th width="250">操作</th>
				</tr>
			</thead>
			<tbody>
				<volist name="storeArray" id="row">
				
					<tr class="list" id="list<?=$row['id']?>">
						<td>{$row['id']}</td>
						<td style="font-weight:bold;">{$row['title']}</td>						
						<td>{$row.rel_name}</td>
						<td>{$row.rel_phone}</td>
						<td>{$row['extraction']*100}%</td>						
						<td><if condition="$row.status eq '1'">营业<else/>停业</if></td>
						<td>{$row.addtime|date='Y-m-d H:i:s',###}</td>						
						<td>
							<php>
								if($row['status']==1){
									$status='关闭店铺';
									$class='btn-danger ';
								}else{
									$status='启用店铺';
									$class='btn-info';
								}
								if($row['recommend']==1){
									$recommend='取消推荐';
									$class1='btn-danger ';
								}else{
									$recommend='推荐';
									$class1='btn-info';
								}
								if($row['spread']==1){
									$spread='取消推广';
									$class2='btn-danger ';
								}else{
									$spread='推广';
									$class2='btn-info';
								}
							</php>
							<div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
								<a class="btn btn-xs btn-info" href="{:U('Store/storeAdd',array('id'=>$row['id']))}">编辑</a>
								<a class="btn btn-xs {$class} aclick" needConfirm="1" content="是否确认{$status}?" href="javascript:;" url="{:U('Store/storeSave',array('id'=>$row['id'],'type'=>'status'))}">{$status}</a>
								<a class="btn btn-xs {$class1} aclick" 
									needConfirm="1" content="是否确认{$recommend}?" href="javascript:;" url="{:U('Store/storeSave',array('id'=>$row['id'],'type'=>'recommend'))}">{$recommend}</a>
								<a class="btn btn-xs {$class2} aclick" needConfirm="1" content="是否确认{$spread}?" href="javascript:;" url="{:U('Store/storeSave',array('id'=>$row['id'],'type'=>'spread'))}">{$spread}</a>
							
								
							</div>
						</td>
					</tr>
				</volist>
			</tbody>
		</table>
		

        <div>{$page} </div>
    </div>
</div>

<include file="Public:footer" />
